<?php
defined('SYS_RUN') or exit();

class Controller_Session extends AController
{
    private $session = null;

    function __construct() {
        $this->session = Lib::get('session');
    }

    public function actionRead($data) {
        $data = Lib::get('session')->read($data['sessionId']);
        $this->response->setData($data)->send();
    }

    public function actionWrite($data) {
        Lib::get('session')->write($data['sessionId'], $data['sessionData']);
        $this->response->send();
    }

    public function actionDestroy($data) {
        Lib::get('session')->destroy($data['sessionId']);
        $this->response->send();
    }
}